package com.wang.vo;


import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.models.auth.In;

import java.math.BigDecimal;

public class CartItemVO {
    /**
     * 商品Id
     */
    @JsonProperty("product_id")
    private Long productId;

    /**
     * 商品价格
     */
    private Integer price;

    /**
     * 商品标题
     */
    private String title;

    /**
     * 商品封面图
     */
    @JsonProperty("cover_img")
    private String coverImg;

    /**
     * 商品数量
     */
    private Integer num;

    /**
     * 商品总价
     */
    @JsonProperty("total_price")
    private BigDecimal totalPrice;

    public BigDecimal getTotalPrice() {
        totalPrice = BigDecimal.valueOf(price.longValue() * num.intValue());
        return totalPrice;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getCoverImg() {
        return coverImg;
    }

    public void setCoverImg(String coverImg) {
        this.coverImg = coverImg;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

}
